import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;


public class Placemark{

	String name;
	protected Color[] colorMap;

	void paintImage(Graphics g, Color color)
	{
		Graphics2D g2d = (Graphics2D) g;
		g2d.setColor(color); 
		g2d.fillRect(8, 8, 6, 6);
		g2d.setColor(Color.black);
		g2d.drawRect(8,8,6,6);
	}

	public BufferedImage getImage(int i) {
		BufferedImage image = new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB);
		Graphics graphics  = image.getGraphics();
		paintImage(graphics, getColorMap()[i]);
		return image;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Placemark(String name, Color[] colorMap) {
		this.name = name;
		this.setColorMap(colorMap);
	}
	
	public int getSize(){
		return this.getColorMap().length;
	}
	
	
	public Placemark() {
		this.name = "name";
		this.setColorMap(new Color[3]);
		{
			getColorMap()[(int)	0	]=new Color(	(float)	0.6	, (float)	0	, (float)	1);	
			getColorMap()[(int)	1	]=new Color(	(float)	1	, (float)	1, (float)	0);		
			getColorMap()[(int)	2	]=new Color(	(float)	0.6	, (float)	0.6	, (float)	0.6);		
		};
	}

	public void setColorMap(Color[] colorMap) {
		this.colorMap = colorMap;
	}

	public Color[] getColorMap() {
		return colorMap;
	}

}